package mode.proxyMode07;

/**
 * 07 静态代理
 */
public class StaticProxyDemo implements ISubject{

    private ISubject realSubject;

    public StaticProxyDemo(ISubject realSubject){
        this.realSubject = realSubject;
    }

    @Override
    public void doSomething() {
        System.out.println("before real subject do something ");
        realSubject.doSomething();
        System.out.println("after .. real subject do something ");

    }


    public static void main(String[] args) {

        StaticProxyDemo staticProxyDemo = new StaticProxyDemo(new RealSubject());
        staticProxyDemo.doSomething();
    }



}


